<?php

class BannersView extends Banners{
	
	public function listar($arr){
		$total = count($arr);
		for($i = 0;$i < $total;$i++){      	
			echo '<tr>';
				echo '<td width="20%"><img src="../imagens/banners/',$arr[$i]['imagem0'],'" width="100" /></td>';
				echo '<td width="30%">',$arr[$i]['ordem'],'</td>';
				echo '<td width="20%" align="center" onclick="javascript:editar(',$arr[$i]['idbanners'],',\'banners\');" class="tabelaB"><img src="images/app-edit-icon.png" width="20" align="absmiddle" /> Editar</td>';
				echo '<td width="20%" id="editar" align="center" onclick="javascript:excluir(',$arr[$i]['idbanners'],',\'Banners\');" class="tabelaB"><img src="images/app-delete-icon.png" width="20" align="absmiddle" /> Excluir</td>';
			echo '</tr>';
	    }
	}
	public function select($arr){
		$total = count($arr);
		echo '<option value = "0">Selecione</option>';
		for($i = 0;$i < $total;$i++){
			echo '<option value="',$arr[$i]['idbanners'],'">',$arr[$i]['nome'],'</option>';
	    }
	}
	public function visualizar($arr){
		$total = count($arr);
		echo '<div class="main_view">';
			echo '<div class="window">';
				echo '<div class="image_reel">';
					for($i = 0;$i < $total;$i++){
						echo '<a href="',$arr[$i]['link'],'" >';
							echo '<img src="imagens/banners/',$arr[$i]['imagem0'],'" width="800" height="260"/>';
						echo '</a>';
					}				
				echo '</div>';
			echo '</div>';
			echo '<br class="clear" />';
			echo '<div class="paging">';
			for($i = 0;$i < $total;$i++){
				echo '<a href="#" rel="',$i+1,'">',$i+1,'</a>';
			}
			echo '</div>';
		echo '</div>';
	}
}
?>